package com.lbw.flyweight;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/6/13 14:33
 */
public class Client {
    public static void main(String[] args) {

        WebsiteFactory websiteFactory = new WebsiteFactory();

        // 客户要一个以新闻形式的发布的网站
        Website website = websiteFactory.getWebsiteCategory("新闻");
        website.use(new User().setName("tom"));

        // 客户要一个以新闻形式的发布的网站
        Website website2 = websiteFactory.getWebsiteCategory("博客");
        website2.use(new User().setName("jacky"));
        System.out.println(websiteFactory.getWebsiteCount());
    }
}
